package com.tarry.controller;

import com.tarry.cache.guava.DictCache;
import com.tarry.entity.Dict;
import com.tarry.web.domian.vo.ResultEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class DictController {

    @Autowired
    DictCache dictCache;

    @GetMapping("get/{beanType}")
    public ResultEntity<List> getDict(@PathVariable String beanType) throws Exception{
        return ResultEntity.success(dictCache.getDictByCache(beanType));
    }
}
